
#include <BDrag>
#include "member_BDrag.h"
#include "IGlobal.h"

using namespace BWE;

#define member						(*(member_BDrag*)_ptr)
#define member_allocate()			_ptr = new member_BDrag(this)
#define member_release()			delete (member_BDrag*)_ptr

BDrag::BDrag()
{
	member_allocate();
}
BDrag::~BDrag()
{
	member_release();
}

BWidget* BDrag::source() const
{
	return member.source;
}
BWidget* BDrag::target() const
{
	return member.target;
}

void BDrag::setImage(BImage* image)
{
	if (member.image != image)
	{
		member.image = image;
	}
}
BImage* BDrag::image() const
{
	return member.image;
}

void BDrag::setText(const BString& text)
{
	if (member.text != text)
	{
		member.text = text;
	}
}
const BString& BDrag::text() const
{
	return member.text;
}

void BDrag::setValue(const BValue& value)
{
	if (member.value != value)
	{
		member.value = value;
	}
}
const BValue& BDrag::value() const
{
	return member.value;
}

int BDrag::execute()
{
	member.over = false;
	while (!member.over)
	{
		App_CycleBegin();
		App_Event(this);
		App_Update();
		App_Frame();
		App_CycleEnd();
	}
	return 0;
}
